//
//  TravelStrokeMiddleModel.m
//  ToWhere
//
//  Created by dllo on 15/11/17.
//  Copyright © 2015年 www.TE.com. All rights reserved.
//

#import "TravelStrokeMiddleModel.h"
#import "TravelStrokeSmallModel.h"


@implementation TravelStrokeMiddleModel

-(void)dealloc
{
    [_memo release];
    [_arrg release];
    [_ID release];
    [super dealloc];
    
}

-(instancetype)initWithNSDictionary:(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        
        self.arrg = [NSMutableArray array];
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}
+(TravelStrokeMiddleModel *)travelStrokeMiddleModelWithNSDictionary:(NSDictionary *)dic
{
    TravelStrokeMiddleModel *model = [[TravelStrokeMiddleModel alloc]initWithNSDictionary:dic];
    return [model autorelease];
    
}

-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"id"]) {
        self.ID = value;
    }
    if ([key isEqualToString:@"plan_nodes"]) {
        NSArray *arrayP = value;
        
        for (NSDictionary *dic in arrayP) {
            
            TravelStrokeSmallModel *SmallModel = [TravelStrokeSmallModel travelStrokeSmallModelWithNSDictionary:dic];
            
            [self.arrg addObject:SmallModel];
        }
        
    }
    
    
}

@end
